<template>
	<view>
		<view class="content">
			<up-cell-group border="false">
				<up-cell icon="info" title="关于我们" isLink arrow-direction="right"></up-cell>
				<up-cell icon="download" title="版本详情" isLink arrow-direction="right"></up-cell>
			</up-cell-group>
		</view>
		<view class="exit">
			<up-button @click="exit" type="primary" color="#d81e06" :hairline="true" hover-class="none" shape="circle"
				text="退出" size='large'></up-button>
		</view>
	</view>
</template>
<script lang="ts" name="user" setup>
	import { loginStore } from "../../store/modules/login"
	import userStore from "../../store/modules/user"
	let login = loginStore()
	let user = userStore()
	const exit = function () {
		uni.showModal({
			// 询问用户是否退出登录
			title: '退出登录',
			content: '您确定要退出登录吗?',
			success: res => {
				if (res.confirm) {
					login.clearProfile()
					user.clearuserId()
					// //确定退出拿到token并清除token
					// let TOKEN = uni.getStorageSync('缓存名称');
					// uni.clearStorageSync();
					//退出成功！并跳转到其他页面
					uni.showToast({
						title: '退出成功',
						icon: 'none',
					});

					console.log("111111");
					setTimeout(function () {
						// uni.switchTab({
						// 	url: 'pages/home/home'
						// });
						uni.navigateBack()
					}, 300);


				} else if (res.cancel) {
					console.log('用户点击取消');
				}
			},
		});


	}
</script>

<style lang="scss">
	.exit {
		margin-top: 200upx;
		width: 600upx;
		margin-left: 75upx;
	}
</style>